﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using KeRui.Common;
public partial class Manage_Seller_AdClickDetails : System.Web.UI.Page
{
    protected List<KeRui.Model.AdClick> List = new List<KeRui.Model.AdClick>();
    private KeRui.BLL.AdClick bllAdClick = new KeRui.BLL.AdClick();
    protected string strTitle = "";
    protected string Url = "";

    protected int scaleMin = 100;
    protected int scaleMax = 100;

    #region 分页
    public int PageSize = 10;                               //每页数量
    public int PageIndex = PageRequest.GetInt("page", 1);   //请求的页码
    public int PageCS = PageRequest.GetInt("cs", -1);       //记录总数
    public int PageCount = 0;                               //总页数
    public string PageShow = "";                            //分页显示
    #endregion 分页
    protected void Page_Load(object sender, EventArgs e)
    {
        int typeID = PageRequest.GetInt("type",1);
        int AdID = PageRequest.GetInt("id",-1);
        string TDate = PageRequest.GetString("tdate");

        scaleMin = PageRequest.GetInt("scaleMin", 100);
        scaleMax = PageRequest.GetInt("scaleMax", 100);

        if (scaleMax < scaleMin)
        {
            scaleMax = scaleMin + 10;
        }

        Url = "type=" + typeID + "&id=" + AdID + "&tdate=" + TDate + "&scaleMin=" + scaleMin + "&scaleMax=" + scaleMax;

        strTitle = TDate;

        switch (typeID)
        {
            case 1:
                strTitle += "（天）";
                break;
            case 2:
                strTitle += "（周）";
                break;
            case 3:
                strTitle += "（月）";
                break;
            case 4:
                strTitle += "（年）";
                break;
        }

        List = bllAdClick.GetList(PageSize, PageIndex, typeID, AdID, TDate);

        //总数
        if (PageCS == -1)
            PageCS = bllAdClick.GetCount(typeID,AdID,TDate);
        //总页数
        if (PageCS % PageSize == 0)
            PageCount = PageCS / PageSize;
        else
            PageCount = PageCS / PageSize + 1;
        //分页显示
        PageShow = ManageHelper.showSplitPage("AdClickDetails.aspx?cs=" + PageCS.ToString() + "&page={0}&" + Url, PageIndex, PageSize, PageCS);

    }
}
